home *** CD-ROM | disk | FTP | other *** search
- Array.prototype.getItemIndex = function(tItem)
- {
- var _loc3_ = this.length;
- var _loc2_ = 0;
- while(_loc2_ < _loc3_)
- {
- if(this[_loc2_] == tItem)
- {
- return _loc2_;
- }
- _loc2_ = _loc2_ + 1;
- }
- return -1;
- };
- this.goto = function(tStr)
- {
- _global.gGameState = tStr;
- this.gotoAndPlay(tStr);
- };
- this.setKeys = function()
- {
- this.keyDetect = new Object();
- this.keyDetect.onKeyDown = function()
- {
- keyPressed(Key.getCode() == 38,Key.getCode() == 40,Key.getCode() == 37,Key.getCode() == 39,Key.getCode() == 32);
- };
- Key.addListener(this.keyDetect);
- this.pKeyDelay = 0;
- this.pKeyActive = true;
- };
- this.setKeyInt = function()
- {
- };
- this.clearKeyInt = function()
- {
- this.pKeyActive = true;
- clearInterval(this.pKeyDelay);
- };
- this.keyPressed = function(aUp, aDown, aLeft, aRight, aAction)
- {
- switch(gGameState)
- {
- case "menu":
- if(aAction)
- {
- this.soul_mc.clearMap();
- this.goto("newGame");
- }
- break;
- case "newGame":
- if(aAction)
- {
- this.goto("game");
- }
- break;
- case "game":
- this.grid_mc.selector_mc.moveSelect(aRight - aLeft,aDown - aUp);
- if(aAction)
- {
- this.grid_mc.selector_mc.pressSelect();
- }
- }
- };
- this.setKeys();
- this.goto("menu");
-